home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / internet-tools / connect-line / cl / rexx / printpointlist.clrexx < prev    next >
Encoding:
Text File  |  1995-11-26  |  2.5 KB  |  100 lines

  1. /*
  2. **  $VER: PrintPointList.clrexx 1.02 (26 Nov 1995)
  3. **
  4. **        © 1995 Ralf Ramge
  5. **
  6. **  PROGRAMNAME:
  7. **      PrintPointList.clrexx
  8. **
  9. **  FUNCTION:
  10. **
  11. **      Demonstrationsskript zur cl_rexx.library, Connectline 5.0
  12. **
  13. **      Connectline © 1986-1995 Oliver Wagner, Mathias Mischler
  14. **      cl-rexx.library © 1995 Mathias Mischler
  15. **
  16. **      Dieses Skript erstellt eine aufsteigend sortierte Liste aller
  17. **      Points und gibt sie direkt auf dem Drucker aus.
  18. **
  19. **  $HISTORY:
  20. **
  21. **      1.0  - Erstes Release
  22. **      1.01 - diverse kosmetische Fixes ;)
  23. **      1.02 - Es wurde nicht nach Pointname sortiert *schluck*
  24. */
  25.  
  26. /* cl_rexx.library öffnen */
  27.  
  28. if ~show('L','cl_rexx.library') then do
  29.     if ~addlib('cl_rexx.library',0,-30,0) then do
  30.         address command 'ASSIGN LIBS: CONNECTLINE:Libs ADD'
  31.         if ~addlib('connectline:libs/cl_rexx.library',0,-30,0) then exit 10
  32.         end
  33.     end
  34.  
  35.  
  36. anzahl=CLGET_UserNumberOf()
  37. ctr=0
  38.  
  39. /* Liste aller Pointuser erstellen */
  40.  
  41. do x=1 to anzahl
  42.     user=CLGET_Username(x)
  43.     point=CLGET_UserPointname(user)
  44.     if point~='' then do                        /* User zwischenspeichern */
  45.         ctr=ctr+1
  46.         pointuser.ctr=user
  47.         pointname.ctr=point
  48.         end
  49.     end
  50.  
  51. /* Liste nach Pointnamen sortieren (Bubblesort) */
  52.  
  53. hvuser=''
  54. hvpoint=''
  55.  
  56. do x=1 to ctr
  57.     do y=1 to ctr-1
  58.         temp=y+1
  59.         if pointname.y>pointname.temp then do
  60.             hvuser=pointuser.temp
  61.             hvpoint=pointname.temp
  62.             pointuser.temp=pointuser.y
  63.             pointname.temp=pointname.y
  64.             pointuser.y=hvuser
  65.             pointname.y=hvpoint
  66.             end
  67.         end
  68.     end
  69.  
  70.  
  71. /* Tabelle erstellen und ausdrucken */
  72.  
  73. userbreite=20
  74. pointbreite=12
  75. uanrufbreite=21
  76. panrufbreite=21
  77.  
  78. call print(center('Username',userbreite)||center('Letzter Anruf',uanrufbreite)||center('Pointname',pointbreite)||center('Letzter Netcall',panrufbreite)||'0a'x)
  79. call print (copies('-',userbreite-1) copies('-',uanrufbreite-1) copies('-',pointbreite-1) copies('-',panrufbreite-1)||'0a'x)
  80.  
  81. do x=1 to ctr
  82.     call print(left(pointuser.x,userbreite)||left(CLGET_UserLastCall(pointuser.x),uanrufbreite)||left(pointname.x,pointbreite)||left(CLGET_SystemLastCall(pointname.x),panrufbreite)'0a'x)
  83.     end
  84.  
  85. call print('0a'x)
  86. call print('Gesamtzahl der Points: 'ctr'0a'x)
  87. exit
  88.  
  89. /* die eigentliche Druckroutine */
  90.  
  91. print:
  92. parse arg druckzeile
  93. if ~show('F','Printer') then do
  94.     if ~open('Printer','PRT:') then do
  95.         return 'ERROR'
  96.         end
  97.     end
  98. return writech('Printer',druckzeile)
  99.  
  100.